1 ' (PC)^3 Software Submission PLTSTKFL authored on January 4, 1983 by
2 '
3 ' Michael Csontos, 3228 Livonia Center Road, Lima, New York 14485
4 '
5 ' Copyright 1983 Michael Csontos
6 '
7 '  This program is made freely available non-exclusively to the Picture
8 '  City Personal Computer Programmers' Club for distribution to its members
9 '  and through software exchange to other users groups as long as credit is
10 ' given to the author and (PC)^3.
11 '
12 '
13 ' NOTE: The files PLTSTKFL.DOC, PLTSEQFL.DAT, and data files with the
14 ' extensions DJA, NYS, OTC, OPT, and MUT are associated with this program.
15 ' Also are PLTSEQFL.ALL, and MONEYMKT.INT.
16 '
10000 GOTO 12000
10100 Y=VAL(RIGHT$(DAT$,4))'  --------------------------------------------------
10200 D=VAL(MID$(DAT$,4,2))'   dat$ as mm-dd-yyyy     |  subroutine
10300 M=VAL(LEFT$(DAT$, 2))'    to  M,D,Y,M$,D$,Y$    |     to
10400 M2030=M+100:D2030=D+100'                        |  decompose
10500 M$=STR$(M2030):D$=STR$(D2030):Y$=STR$(Y)'       |    dates
10600 M$=RIGHT$(M$,2):D$=RIGHT$(D$,2):Y$=RIGHT$(Y$,4)'|    into
10700 RETURN'    -------------------------------------  strings & numbers  -----
10800 M3000=M:Y3000=Y'   -------------------------------------------------------
10900 IF M3000>2 THEN 11100'
11000 M3000=M3000+12:Y3000=Y3000-1'
11100 N=2+D+M3000*2+Y3000+INT(Y3000/4)-INT(Y3000/100)+INT(Y3000/400)+INT(.6*(M3000+1))'
11200 ON 1+INT(1/2+(N/7-INT(N/7))*7) GOTO 11300,11400,11500,11600,11700,11800,11900'
11300 DAYNAME$="SAT.":RETURN'
11400 DAYNAME$="SUN.":RETURN'         Subroutine to give day of week
11500 DAYNAME$="MON.":RETURN'
11600 DAYNAME$="TUE.":RETURN'                     from
11700 DAYNAME$="WED.":RETURN'
11800 DAYNAME$="THU.":RETURN'            integers M, D, & Y.
11900 DAYNAME$="FRI.":RETURN'--------------------------------------------------
12000 KEY OFF:CLS:WIDTH "lpt1:",255
12100 LIN=CSRLIN:LOCATE 25,1:COLOR 0,7:PRINT STRING$(79," ");:COLOR 7,0:LOCATE LIN,1
12200 ON ERROR GOTO 12700
12300 OPEN "moneymkt.int" FOR INPUT AS #1
12400 INPUT #1, ANINT
12500 CLOSE #1:ON ERROR GOTO 0:GOTO 13100
12600 ON ERROR GOTO 0: GOTO 13200
12700 IF ERR=53 THEN NOINTFL=1:RESUME 12900
12800 ON ERROR GOTO 0
12900 ON ERROR GOTO 0
13000 PRINT:INPUT "Current money market fund interest rate (%)";ANINT
13100 IF ANINT<1 OR ANINT>100 THEN ANLMFR=.1 ELSE ANLMFR=ANINT/100
13200 RESPMSG$="PRESS A NUMBER KEY CORRESPONDING TO YOUR SELECTION OR PRESS <Esc> TO QUIT."
13300 DIM GRAPH$(132)
13400 DIM MTH$(12):MTH$(1)="JAN.":MTH$(2)="FEB.":MTH$(3)="MAR.":MTH$(4)="APR.":MTH$(5)="MAY.":MTH$(6)="JUN.":MTH$(7)="JUL.":MTH$(8)="AUG.":MTH$(9)="SEP.":MTH$(10)="0CT.":MTH$(11)="NOV.":MTH$(12)="DEC."
13500 ON ERROR GOTO 13700' -----------------select task-----------------------
13600 OPEN "pltseqfl.dat" FOR INPUT AS #3:GOTO 13800
13700 NOSEQ=1:RESUME 13800
13800 ON ERROR GOTO 0
13900 ON ERROR GOTO 14000:OPEN "pltstkfl.doc" FOR INPUT AS #1:CLOSE #1:GOTO 14100
14000 NODOC=1:RESUME 14100
14100 ON ERROR GOTO 0:IF NOSEQ AND NODOC THEN 16300
14200 PRINT:PRINT "Do you want to ";
14300 IF NODOC THEN 14600
14400 PRINT "(1):  read the documentation file for this program,
14500 PRINT " or            (2):  plot a single securities file,
14600 IF NODOC=0 THEN 14700 ELSE PRINT "(2):  plot a single securities file,
14700 IF NOSEQ THEN 15000
14800 PRINT " or            (3):  plot all files for a single type of security,
14900 PRINT " or            (4):  plot all security files,
15000 PRINT " or            <Esc> to quit?":IF NOSEQ THEN 15300
15100 PRINT "     NOTE: The security must be listed in the file PLTSEQFL.DAT
15200 PRINT "           in order to be plotted in options 3 or 4.
15300 X$=INKEY$:IF X$="" THEN 15300 ELSE IF X$=CHR$(27) THEN 17200 ELSE AA=VAL(X$)
15400 IF AA<1 OR AA>4 THEN PRINT:PRINT RESPMSG$:GOTO 15300
15500 IF NOSEQ THEN IF AA<1 OR AA>2 THEN PRINT:PRINT RESPMSG$:GOTO 15300
15600 ON AA GOTO 15700,15800,15900,16000
15700 AA$="DOCUMENTATION":GOTO 16100
15800 AA$="SINGLE FILE":GOTO 16100
15900 AA$="SINGLE TYPE":GOTO 16100
16000 AA$="ALL FILES":GOTO 16100
16100 LIN=CSRLIN:LOCATE 25,60:COLOR 0,7:PRINT AA$;:COLOR 7,0:LOCATE LIN,1
16200 ON AA GOTO 52500
16300 PRINT'     ---------------- select type of plot - B -------------------
16400 PRINT "Do you want (1): a continuous plot of medium resolution,
16500 PRINT " or         (2): a continuous plot of fine resolution,
16600 PRINT " or         (3): 11 inch plot of the latest data in medium resolution,
16700 PRINT " or         (4): 11 inch plot of the latest data in fine resolution,
16800 PRINT " or            <Esc>: to quit?"
16900 X$=INKEY$:IF X$="" THEN 16900 ELSE IF X$=CHR$(27) THEN 17200 ELSE B=VAL(X$)
17000 IF B<1 OR B>4 THEN PRINT:PRINT RESPMSG$:GOTO 16900
17100 ON B GOTO 17300,17400,17500,17600
17200 KEY ON:END
17300 B$="MED. CONT.":GOTO 17700
17400 B$="FINE. CONT.":GOTO 17700
17500 B$="MED. 11 IN.":GOTO 17700
17600 B$="FINE 11 IN.":GOTO 17700
17700 LIN=CSRLIN:LOCATE 25,1:COLOR 0,7:PRINT B$;:COLOR 7,0:LOCATE LIN,1
17800 ON AA GOTO 17200,17900,17900,20000
17900 PRINT'     -------------- select type of file to be processed - C -----
18000 PRINT "Is the file for (1): Dow Jones Averages,
18100 PRINT " or             (2): New York Stock Exchange,
18200 PRINT " or             (3): Over the Counter Markets,
18300 PRINT " or             (4): Options,
18400 PRINT " or             (5): Mutual Funds,
18500 PRINT " or             <Esc>: to quit?"
18600 X$=INKEY$:IF X$="" THEN 18600 ELSE IF X$=CHR$(27) THEN 17200 ELSE C=VAL(X$)
18700 IF C<1 OR C>5 THEN PRINT:PRINT RESPMSG$:GOTO 18600
18800 ON C GOTO 18900,19000,19100,19200,19300
18900 EXT$=".DJA":GOTO 19400
19000 EXT$=".NYS":GOTO 19400
19100 EXT$=".OTC":GOTO 19400
19200 EXT$=".OPT":GOTO 19400
19300 EXT$=".MUT":GOTO 19400
19400 LIN=CSRLIN:LOCATE 25,15:COLOR 0,7:PRINT "FILE FOR " EXT$;:COLOR 7,0:LOCATE LIN,1
19500 ON AA GOTO 17200,19600,20000,20000
19600 GOSUB 37600 ' GETFILE  --------- select file - FILESPEC$ --------------
19700 IF NOFILE OR BADFILE THEN PRINT "PROGRAM TERMINATED":CLOSE:KEY ON:END
19800 LIN=CSRLIN:LOCATE 25,15:COLOR 0,7:PRINT "FILE FOR " FILESPEC$;:COLOR 7,0:LOCATE LIN,1
19900 IF C=1 OR C=2 OR C=3 THEN 20000 ELSE 21400' -- select data - DD -------
20000 PRINT
20100 PRINT "Do you want a plot of  (1): Prices,
20200 PRINT " or                    (2): Volume,
20300 PRINT " or                    (3): both (first Prices, then Volume),
20400 PRINT " or                    <Esc> to quit?"
20500 X$=INKEY$:IF X$="" THEN 20500 ELSE IF X$=CHR$(27) THEN 17200 ELSE DD=VAL(X$)
20600 IF DD<1 OR DD>4 THEN PRINT:PRINT RESPMSG$:GOTO 20500
20700 ON DD GOTO 20800,20900,21000
20800 PLOT$="PRICES":GOTO 21100
20900 PLOT$="VOLUME":GOTO 21100
21000 PLOT$="PRICES, THEN VOLUME":GOTO 21100
21100 LIN=CSRLIN:LOCATE 25,40:COLOR 0,7:PRINT PLOT$;:COLOR 7,0:LOCATE LIN,1
21200 ON AA GOTO 17200,21300,50600,50600
21300 ON DD GOTO 21400,34700,21400' ---------plot price data ----------------
21400 LPRINT CHR$(27) CHR$(64) CHR$(14) CHR$(27) CHR$(45) CHR$(1) CHR$(15) DATE$ "/" TIME$ CHR$(18) CHR$(27) CHR$(69) "     PRICE     " CHR$(27) CHR$(71) FILESPEC$ CHR$(27) CHR$(72) CHR$(27) CHR$(45) CHR$(0)
21500 IF B=3 OR B=4 THEN GOSUB 40500' skipdays
21600 ON C GOTO 21800,21800,28100,41600,28100'
21700 '----------------------------------------------------C = 1 or 2--------
21800 MAXHIGH=0:MINLOW=65000!:SUMCLSE=0:DAYS=0
21900 IF EOF(1) THEN CLOSE #1:GOTO 22800' ------------determine scale-----------
22000 INPUT #1,ENDDATE$,VOLUME,HIGH,LOW,CLSE
22100 IF HIGH=0 THEN 22300
22200 IF HIGH>MAXHIGH THEN MAXHIGH=HIGH
22300 IF LOW=0 THEN 22500
22400 IF LOW<MINLOW THEN MINLOW=LOW
22500 IF CLSE=0 THEN 22700
22600 SUMCLSE=SUMCLSE+CLSE:DAYS=DAYS+1
22700 GOTO 21900
22800 AVERAGE=SUMCLSE/DAYS
22900 RANGE=MAXHIGH-MINLOW
23000 LPRINT CHR$(27) CHR$(70) CHR$(15) CHR$(27) CHR$(48);
23100 LPRINT "A = average closing value of all data plotted =";:LPRINT USING "####.###";AVERAGE;
23200 LPRINT "   The numbers to the right of the dates below are the daily closing prices."
23300 LPRINT "The lowest low plotted is ";:LPRINT USING "####.###";MINLOW;
23400 LPRINT ".  The highest high plotted is ";:LPRINT USING "####.###";MAXHIGH;
23500 LPRINT ".  That high is ";:LPRINT USING "####.#";(MAXHIGH-MINLOW)/MINLOW*100;:LPRINT "% greater than that low."
23600 LPRINT CHR$(27) CHR$(45) CHR$(1);
23700 LPRINT " M = The value of money equal to the average closing value at the start of the plot, compounded daily at ";:LPRINT USING "###.##";ANLMFR*100;:LPRINT "%/yr."
23800 LPRINT CHR$(27) CHR$(45) CHR$(0);
23900 IF B=2 OR B=4 THEN LPRINT CHR$(27) CHR$(83) CHR$(INT(VAL(RIGHT$(TIME$,1))/5)) CHR$(27) CHR$(65) CHR$(4);
24000 MULTIPLIER=130/RANGE
24100 OFFSET=MINLOW*MULTIPLIER-1
24200 AV=INT(MULTIPLIER*AVERAGE-OFFSET)
24300 MFND=AVERAGE:MFRATE=ANLMFR/255
24400 GOSUB 41000
24500 IF EOF(1) THEN 27700' ---------plot price data - C = 1 or 2------------
24600 MFND=MFND+MFND*MFRATE
24700 IF MFND>MAXHIGH THEN MFND=MAXHIGH
24800 MF=INT(MULTIPLIER*MFND-OFFSET)
24900 INPUT #1, DAT$,VOL,HIGH,LOW,CLSE
25000 IF HIGH=0 THEN HI=AV:GOTO 25200
25100 HI=INT(MULTIPLIER*HIGH-OFFSET)
25200 IF CLSE=0 THEN CL=AV:GOTO 25400
25300 CL=INT(MULTIPLIER*CLSE-OFFSET)
25400 IF LOW=0  THEN LO=AV:GOTO 25800
25500 LO=INT(MULTIPLIER*LOW-OFFSET)
25600 IF LO<40 THEN TEXT=1
25700 IF HI>90 THEN TEXT=0
25800 GOSUB 10100 ' decompose date
25900 GOSUB 10800 ' get DAYNAME$
26000 IF B=2 OR B=4 THEN IF DAYNAME$<>"FRI." AND TEXT=0 THEN LPRINT STRING$(27," ");:GOTO 26300
26100 TEXT$=DAYNAME$+" "+MTH$(M)+" "+D$+", "+Y$+" ####.###"
26200 IF TEXT=0 THEN LPRINT USING TEXT$;CLSE;
26300 FOR N=1 TO 132:GRAPH$(N)=" ":NEXT
26400 IF HIGH=0 AND LOW=0 AND CLSE=0 THEN GRAPH$(AV)="A":GOTO 27300
26500 FOR N=LO TO HI:GRAPH$(N)="#":NEXT
26600 IF HI<AV THEN FOR N=HI TO AV:GRAPH$(N)="-":NEXT
26700 IF AV<LO THEN FOR N=AV TO LO:GRAPH$(N)="-":NEXT
26800 GRAPH$(AV)="A"
26900 GRAPH$(MF)="M"
27000 GRAPH$(LO)="L"
27100 GRAPH$(HI)="H"
27200 GRAPH$(CL)="C"
27300 IF TEXT=0 THEN FOR N=28 TO 132:LPRINT GRAPH$(N);:NEXT:LPRINT:GOTO 24500
27400 FOR N=1 TO 100:LPRINT GRAPH$(N);:NEXT
27500 IF B=2 OR B=4 THEN IF DAYNAME$<>"FRI." THEN LPRINT:GOTO 24500
27600 LPRINT USING TEXT$;CLSE:GOTO 24500
27700 LPRINT TIME$:CLOSE #1
27800 IF B=3 OR B=4 THEN LPRINT CHR$(12) ELSE LPRINT:LPRINT
27900 IF DD=3 THEN 34700
28000 IF AA>2 THEN 50600 ELSE KEY ON:END
28100 '----------------------------------------------------C = 3 or 5--------
28200 MINBID=65000!:MAXASK=0:SUMBID=0:DAYS=0
28300 IF EOF(1) THEN CLOSE #1:GOTO 29100' ------------determine scale-----------
28400 INPUT #1,ENDDATE$,VOLUME,BID,ASK,DUMP
28500 IF ASK=0 THEN 28700
28600 IF ASK>MAXASK THEN MAXASK=ASK
28700 IF BID=0 THEN 28300
28800 IF BID<MINBID THEN MINBID=BID
28900 SUMBID=SUMBID+BID:DAYS=DAYS+1
29000 GOTO 28300
29100 AVERAGE=SUMBID/DAYS
29200 RANGE=MAXASK-MINBID
29300 LOWER$="low":HIGHER$="high"
29400 IF C=3 THEN LOWER$="bid":HIGHER$="asked"
29500 IF C=5 THEN LOWER$="NAV":HIGHER$="offer"
29600 LPRINT CHR$(27) CHR$(70) CHR$(15) CHR$(27) CHR$(48);
29700 LPRINT "A = average " LOWER$ " price of all data plotted =";:LPRINT USING "####.###";AVERAGE;
29800 LPRINT "   The numbers to the right of the dates below are the daily " LOWER$ " prices."
29900 LPRINT "The lowest " LOWER$ " plotted is ";:LPRINT USING "####.###";MINBID;
30000 LPRINT ".  The highest " HIGHER$ " price plotted is ";:LPRINT USING "####.###";MAXASK;
30100 LPRINT ".  That high is ";:LPRINT USING "####.#";(MAXASK-MINBID)/MINBID*100;:LPRINT "% greater than that low."
30200 LPRINT CHR$(27) CHR$(45) CHR$(1);
30300 LPRINT " M = The value of money equal to the average " LOWER$ " value at the start of the plot, compounded daily at ";:LPRINT USING "###.##";ANLMFR*100;:LPRINT "%/yr."
30400 LPRINT CHR$(27) CHR$(45) CHR$(0);
30500 IF B=2 OR B=4 THEN LPRINT CHR$(27) CHR$(83) CHR$(INT(VAL(RIGHT$(TIME$,1))/5)) CHR$(27) CHR$(65) CHR$(4);
30600 MULTIPLIER=130/RANGE
30700 OFFSET=MINBID*MULTIPLIER-1
30800 AV=INT(MULTIPLIER*AVERAGE-OFFSET)
30900 MFND=AVERAGE:MFRATE=ANLMFR/255
31000 GOSUB 41000
31100 IF EOF(1) THEN 34300' ---------plot price data - C = 3 or 5------------
31200 MFND=MFND+MFND*MFRATE
31300 MF=INT(MULTIPLIER*MFND-OFFSET)
31400 INPUT #1, DAT$,VOL,BID,ASK,DUMP
31500 IF ASK=0 THEN AS=AV:GOTO 31700
31600 AS=INT(MULTIPLIER*ASK-OFFSET)
31700 IF BID=0  THEN BI=AV:GOTO 32100
31800 BI=INT(MULTIPLIER*BID-OFFSET)
31900 IF BI<40 THEN TEXT=1
32000 IF AS>90 THEN TEXT=0
32100 GOSUB 10100 ' decompose date
32200 GOSUB 10800 ' get DAYNAME$
32300 IF B=2 OR B=4 THEN IF DAYNAME$<>"FRI." AND TEXT=0 THEN LPRINT STRING$(27," ");:GOTO 32600
32400 TEXT$=DAYNAME$+" "+MTH$(M)+" "+D$+", "+Y$+" ####.###"
32500 IF TEXT=0 THEN LPRINT USING TEXT$;BID;
32600 FOR N=1 TO 132:GRAPH$(N)=" ":NEXT
32700 IF ASK=0 AND BID=0 THEN GRAPH$(AV)="A":GOTO 33900
32800 FOR N=BI TO AS:GRAPH$(N)="#":NEXT
32900 IF AS<AV THEN FOR N=AS TO AV:GRAPH$(N)="-":NEXT
33000 IF AV<BI THEN FOR N=AV TO BI:GRAPH$(N)="-":NEXT
33100 GRAPH$(MF)="M"
33200 GRAPH$(AV)="A"
33300 GRAPH$(BI)="L"
33400 GRAPH$(AS)="H"
33500 IF C=3 THEN GRAPH$(BI)="B"
33600 IF C=5 THEN GRAPH$(BI)="N"
33700 IF C=3 THEN GRAPH$(AS)="K"
33800 IF C=5 THEN GRAPH$(AS)="O"
33900 IF TEXT=0 THEN FOR N=28 TO 132:LPRINT GRAPH$(N);:NEXT:LPRINT:GOTO 31100
34000 FOR N=1 TO 100:LPRINT GRAPH$(N);:NEXT
34100 IF B=2 OR B=4 THEN IF DAYNAME$<>"FRI." THEN LPRINT:GOTO 31100
34200 LPRINT USING TEXT$;BID:GOTO 31100
34300 LPRINT TIME$:CLOSE #1
34400 IF B=3 OR B=4 THEN LPRINT CHR$(12) ELSE LPRINT:LPRINT
34500 IF DD=3 AND C=3 THEN 34700
34600 IF AA>2 THEN 50600 ELSE KEY ON:END
34700 '-----------------------------PLOT VOLUME DATA-------------------------
34800 LPRINT CHR$(27) CHR$(64) CHR$(14) CHR$(27) CHR$(45) CHR$(1) CHR$(15) DATE$ "/" TIME$ CHR$(18) CHR$(27) CHR$(69) "    VOLUME    " CHR$(27) CHR$(71) FILESPEC$ CHR$(27) CHR$(72) CHR$(27) CHR$(45) CHR$(0)
34900 IF B=3 OR B=4 THEN IF DD=3 THEN GOSUB 41000 ELSE GOSUB 40500' skipdays
35000 IF B=1 OR B=2 THEN IF DD=3 THEN OPEN FILESPEC$ FOR INPUT AS #1
35100 INPUT #1, STARTDATE$,MAXVOL,HIGH,LOW,CLSE
35200 IF EOF(1) THEN CLOSE #1:GOTO 35600
35300 INPUT #1, ENDDATE$,VOL,HIGH,LOW,CLSE
35400 IF VOL>MAXVOL THEN MAXVOL=VOL
35500 GOTO 35200
35600 LPRINT:LPRINT " V = the volume traded on the day.
35700 LPRINT CHR$(27) CHR$(70) CHR$(15) CHR$(27) CHR$(48);
35800 IF B=2 OR B=4 THEN LPRINT CHR$(27) CHR$(83) CHR$(INT(VAL(RIGHT$(TIME$,1))/5)) CHR$(27) CHR$(65) CHR$(4);
35900 MULTIPLIER=100/MAXVOL
36000 GOSUB 41000
36100 IF EOF(1) THEN CLOSE #1:GOTO 37400
36200 INPUT #1, DAT$,VOL,HIGH,LOW,CLSE
36300 VL=INT(MULTIPLIER*VOL)
36400 GOSUB 10100:GOSUB 10800' decompose date and get dayname
36500 IF B=2 OR B=4 THEN IF DAYNAME$<>"FRI." THEN LPRINT STRING$(27," ");:GOTO 36900
36600 TEXT$=DAYNAME$+" "+MTH$(M)+" "+D$+", "+Y$+"#########"
36700 IF C=3 OR C=4 THEN VOL=VOL*100
36800 LPRINT USING TEXT$;VOL;
36900 FOR N=1 TO 102:GRAPH$(N)=" ":NEXT
37000 FOR N=1 TO VL:GRAPH$(N)="#":NEXT
37100 GRAPH$(VL)="V":GRAPH$(1)=CHR$(156)
37200 FOR N=1 TO 102:LPRINT GRAPH$(N);:NEXT
37300 LPRINT:GOTO 36100
37400 IF B=3 OR B=4 THEN LPRINT CHR$(12) ELSE LPRINT:LPRINT
37500 IF AA>2 THEN 50600 ELSE KEY ON:END
37600 ON ERROR GOTO 39100:NOFILE=0'  ------------GETFILE---------------------
37700 IF ERR=62 THEN PRINT "Bad file data. You are trying to read from the wrong file. Try again.":RESUME 37600
37800 PRINT:PRINT "The following files are on the disk.":FILES "*"+EXT$
37900 ON ERROR GOTO 0
38000 PRINT:PRINT "What is the filename of the one you want to use":INPUT "(if none type NONE)";FI$
38100 FILENAME$=""
38200 FOR N=1 TO LEN(FI$):LTR$=MID$(FI$,N,1)
38300 IF "a"<=LTR$ AND LTR$<="z" THEN LTR$=CHR$(ASC(LTR$)-32)
38400 FILENAME$=FILENAME$+LTR$
38500 NEXT N
38600 IF FILENAME$="NONE" THEN NOFILE=1:RETURN
38700 FILESPEC$=FILENAME$+EXT$
38800 ON ERROR GOTO 39100:OPEN FILESPEC$ FOR INPUT AS #1
38900 ON ERROR GOTO 0:RETURN
39000 '-----------------------disk error handling----------------------------
39100 IF ERR=24 THEN PRINT "No disk in drive? Device timeout.":GOTO 40400
39200 IF ERR=52 THEN PRINT "Bad file name. ":RESUME 38000
39300 IF ERR=53 AND ERL=37800 THEN PRINT "There are do files for this type of security on this disk.":NOFILE=1:RESUME 38900
39400 IF ERR=53 AND ERL=38800 THEN PRINT "The disk has no file by that name.:resume 23600
39500 IF ERR=57 THEN PRINT "I/O error. Try another disk.":GOTO 40400
39600 IF ERR=61 THEN PRINT "Disk full. Try another disk.":GOTO 40400
39700 IF ERR=64 THEN PRINT "Bad file name. ":RESUME 38000
39800 IF ERR=67 THEN PRINT "Too many files in directory. Try another disk to temoroarily save your data.":GOTO 40400
39900 IF ERR=68 THEN PRINT "Disk drive unavailable.":GOTO 40400
40000 IF ERR=70 THEN PRINT "You have write protected this disk!":GOTO 40400
40100 IF ERR=71 THEN PRINT "No disk in drive or door not closed.":GOTO 40400
40200 IF ERR=72 THEN PRINT "Disk Media Error. Try another disk.":GOTO 40400
40300 PRINT:PRINT "DISK PROBLEM ";:CLOSE:ON ERROR GOTO 0:KEY ON:END
40400 PRINT "Program will continue when problem is corrected.":LOCATE CSRLIN-2,1:RESUME
40500 DAYSS=0'    ----------------------------------------skipdays start-------
40600 IF EOF(1) THEN CLOSE #1:GOTO 40900
40700 INPUT #1, DUMP$:FOR N=1 TO 4: INPUT #1, DUMP:NEXT
40800 DAYSS=DAYSS+1:GOTO 40600
40900 IF B=3 THEN SKIP=DAYSS-80 ELSE SKIP=DAYSS-200
41000 OPEN FILESPEC$ FOR INPUT AS #1' -----------skipdays after first pass----
41100 IF SKIP<=0 THEN RETURN
41200 FOR SK=1 TO SKIP
41300 INPUT #1, DUMP$:FOR N=1 TO 4:INPUT #1, DUMP:NEXT N
41400 NEXT SK
41500 RETURN'    ----------------------------------------skipdays end---------
41600 '----------------------------------OPTIONS----------- C = 4 ------------
41700 MAXCAL=0:MAXPTT=0:MAXL=0:MINCAL=65000!:MINPTT=65000!:MINL=65000!
41800 IF EOF(1) THEN CLOSE #1:GOTO 43100' -----------determine scale--------
41900 INPUT #1,ENDDATE$,DUMP,CAL,PTT,CLSE
42000 IF CAL=0 THEN 42300
42100 IF CAL>MAXCAL THEN MAXCAL=CAL
42200 IF CAL<MINCAL THEN MINCAL=CAL
42300 IF PTT=0 THEN 42600
42400 IF PTT<MINPTT THEN MINPTT=PTT
42500 IF PTT>MAXPTT THEN MAXPTT=PTT
42600 IF CLSE=0 THEN 43000
42700 LLL=CLSE-CAL:TTT=CLSE+PTT
42800 IF LLL<MINL THEN MINL=LLL
42900 IF TTT>MAXT THEN MAXT=TTT
43000 GOTO 41800
43100 RANGECAL=MAXCAL-MINCAL
43200 RANGEPTT=MAXPTT-MINPTT
43300 RANGEUUU=MAXT-MINL
43400 LPRINT CHR$(27) CHR$(70) CHR$(15) CHR$(27) CHR$(48);
43500 LPRINT "P = PUT price.  C = CALL price.   U = closing price of underlying stock. L = U - C.  T = U + P.   S = strike price (from FILENAME).
43600 LPRINT "   The numbers to the right of the dates below are L  and T in that order.  P, C, & L-U-S-T scales are completely independent.
43700 LPRINT "The lowest PUT is:";:LPRINT USING "####.###";MINPTT;
43800 LPRINT ".  The highest PUT is:";:LPRINT USING "####.###";MAXPTT;
43900 LPRINT ".  This is a ";:LPRINT USING "####.#";(MAXPTT-MINPTT)/MINPTT*100;:LPRINT "% increase or a ";:LPRINT USING "####.#";(MAXPTT-MINPTT)/MAXPTT*100;:LPRINT "% decrease."
44000 LPRINT CHR$(27) CHR$(45) CHR$(1);
44100 LPRINT "The lowest CALL is:";:LPRINT USING "####.###";MINCAL;
44200 LPRINT ".  The highest CALL is:";:LPRINT USING "####.###";MAXCAL;
44300 LPRINT ".  This is a ";:LPRINT USING "####.#";(MAXCAL-MINCAL)/MINCAL*100;:LPRINT "% increase or a ";:LPRINT USING "####.#";(MAXCAL-MINCAL)/MAXCAL*100;:LPRINT "% decrease."
44400 LPRINT CHR$(27) CHR$(45) CHR$(0);
44500 IF B=2 OR B=4 THEN LPRINT CHR$(27) CHR$(83) CHR$(INT(VAL(RIGHT$(TIME$,1))/5)) CHR$(27) CHR$(65) CHR$(4);
44600 MULTIPLCAL=105/RANGECAL
44700 MULTIPLPTT=105/RANGEPTT
44800 MULTIPLUUU=105/RANGEUUU
44900 OFFCAL=MINCAL*MULTIPLCAL-2
45000 OFFPTT=MINPTT*MULTIPLPTT-2
45100 OFFUUU=MINL*MULTIPLUUU-2
45200 STRIKE=VAL(RIGHT$(FILENAME$,2))
45300 ST=INT(MULTIPLUUU*STRIKE-OFFUUU)
45400 GOSUB 41000
45500 CL=INT(MULTIPLUUU*CLSE-OFFUUU)
45600 CA=INT(MULTIPLCAL*CAL-OFFCAL)
45700 LLL=CLSE-CAL
45800 LL=INT(MULTIPLUUU*LLL-OFFUUU)
45900 PT=INT(MULTIPLPTT*PTT-OFFPTT)
46000 TTT=CLSE+PTT
46100 TT=INT(MULTIPLUUU*TTT-OFFUUU)
46200 IF EOF(1) THEN 50200' ---------plot price data - C = 4 OPTIONS---------
46300 INPUT #1, DAT$,DUMP,CAL,PTT,CLSE
46400 IF CLSE=0 THEN 46600
46500 CL=INT(MULTIPLUUU*CLSE-OFFUUU)
46600 IF CAL=0 THEN 47100
46700 CA=INT(MULTIPLCAL*CAL-OFFCAL)
46800 IF CLSE=0 THEN 47100
46900 LLL=CLSE-CAL
47000 LL=INT(MULTIPLUUU*LLL-OFFUUU)
47100 IF PTT=0 THEN 47700
47200 LLL=CLSE-CAL
47300 PT=INT(MULTIPLPTT*PTT-OFFPTT)
47400 IF CLSE=0 THEN 47700
47500 TTT=CLSE+PTT
47600 TT=INT(MULTIPLUUU*TTT-OFFUUU)
47700 GOSUB 10100 ' decompose date
47800 GOSUB 10800 ' get DAYNAME$
47900 IF B=2 OR B=4 THEN IF DAYNAME$<>"FRI." THEN LPRINT STRING$(21," ");:GOTO 48300
48000 TEXT$=MTH$(M)+" "+D$+"###.###"
48100 IF CAL=0 AND PTT=0 AND CLSE=0 THEN LLL=0:TTT=0
48200 LPRINT USING TEXT$;LLL;:LPRINT USING "###.###";TTT;
48300 FOR N=1 TO 132:GRAPH$(N)=" ":NEXT
48400 IF CAL=0 AND PTT=0 AND CLSE=0 THEN LPRINT:GOTO 46200
48500 IF CAL=0 THEN 48700
48600 FOR N= LL TO CL:GRAPH$(N)="-":NEXT
48700 IF PTT=0 THEN 48900
48800 FOR N= CL TO TT:GRAPH$(N)="+":NEXT
48900 GRAPH$(ST)="S"
49000 IF PTT=0 THEN 49200
49100 GRAPH$(TT)="T"
49200 IF CAL=0 THEN 49400
49300 GRAPH$(LL)="L"
49400 GRAPH$(CL)="U"
49500 IF PTT=0 THEN 49700
49600 GRAPH$(PT-1)="#":GRAPH$(PT)="P":GRAPH$(PT+1)="#"
49700 IF CAL=0 THEN 49900
49800 GRAPH$(CA-1)="#":GRAPH$(CA)="C":GRAPH$(CA+1)="#"
49900 GRAPH$(0)=CHR$(156)
50000 FOR N=0 TO 109:LPRINT GRAPH$(N);:NEXT
50100 LPRINT :GOTO 46200
50200 LPRINT TIME$:CLOSE #1
50300 IF B=3 OR B=4 THEN LPRINT CHR$(12) ELSE LPRINT:LPRINT
50400 IF AA>2 THEN 50600 ELSE KEY ON:END
50500 '----------------------------READ SEQUENCE FILE------------------------
50600 IF EOF(3) THEN CLOSE #3:KEY ON:END
50700 INPUT #3, FI$
50800 FILESPEC$=""
50900 FOR N=1 TO LEN(FI$):LTR$=MID$(FI$,N,1)
51000 IF "a"<=LTR$ AND LTR$<="z" THEN LTR$=CHR$(ASC(LTR$)-32)
51100 FILESPEC$=FILESPEC$+LTR$
51200 NEXT N
51300 SECTYPE$=RIGHT$(FILESPEC$,4)
51400 NAMELENGTH=INSTR(FILESPEC$,".")-1
51500 FILENAME$=LEFT$(FILESPEC$,NAMELENGTH)
51600 IF AA=3 THEN 52400
51700 EXT$=SECTYPE$
51800 IF EXT$=".DJA" THEN C=1
51900 IF EXT$=".NYS" THEN C=2
52000 IF EXT$=".OTC" THEN C=3
52100 IF EXT$=".OPT" THEN C=4
52200 IF EXT$=".MUT" THEN C=5
52300 OPEN FILESPEC$ FOR INPUT AS #1:GOTO 21300
52400 IF SECTYPE$=EXT$ THEN 52300 ELSE 50600
52500 OPEN "PLTSTKFL.DOC" FOR INPUT AS #1 '-------------READ DOCUMENTATION-----
52600 PRINT:PRINT:PRINT:PRINT
52700 FOR N=1 TO 20
52800 IF EOF(1) THEN ENDDOC=1:GOTO 53200
52900 LINE INPUT #1, DOCULINE$
53000 PRINT DOCULINE$
53100 NEXT N
53200 LIN=CSRLIN:LOCATE 25,1:COLOR 0,7:PRINT "Press any key to continue except <Esc>, which will the program.                ";:COLOR 7,0:LOCATE LIN,1
53300 X$=INKEY$:IF X$="" THEN 53300 ELSE IF X$=CHR$(27) THEN 17200 ELSE 53400
53400 LIN=CSRLIN:LOCATE 25,1:COLOR 0,7:PRINT STRING$(79," ");:COLOR 7,0:LOCATE LIN,1
53500 IF ENDDOC THEN CLOSE #1:ENDDOC=0:PRINT:PRINT:PRINT:PRINT "END OF DOCUMENTATION FILE":PRINT:PRINT:GOTO 14200
53600 GOTO 52700
65000 '         SAVE"pltstkfl.bas",a
